import sys
import pyautogui
from pywinauto import mouse
from win32api import GetSystemMetrics
#sys.path.append("C:\Users\Administrator\Desktop\python+sikulix\Sikulix\Lib")
#sys.path.append("C:\Users\Administrator\Desktop\python+sikulix\SikulixIDE\sikulixapi.jar")
#from sikuli import *
def click(png_name):
    b = pyautogui.locateOnScreen(png_name)
    z , c = pyautogui.center(b)
    pyautogui.click(z,c)

click("jiegou.png") #点击结构
click("qiang.png")  #点击墙
click("xiugai.png")
click("huaqiang.png") #选择画墙工具

xc = int(pyautogui.size()[0]/2)
yc = int(pyautogui.size()[1]/2)
#屏幕中心坐标
xd = xc + 300
yd = yc + 300
mouse.press(button='left',coords=(xc,yc))
#mouse.move(coords=(xd,yd))
mouse.release(button='left',coords=(xd,yd))
mouse.click(coords=(xd,yd))

click("qiangshixian.png")

sx = xc + (xd - xc) // 3
#yd
mouse.press(button='left',coords=(sx,yc))
mouse.release(button='left',coords=(sx,yd))
mouse.click(coords=(sx,yd))

tt = yc + (yd - yc)//4
#sx,tt
ssx = xc + (xd - xc) // 2
#ssx,tt
mouse.click(coords=(sx,tt))
mouse.move(coords=(ssx,tt))
mouse.click(coords=(ssx,tt))
mouse.move(coords=(ssx,yd))
mouse.click(coords=(ssx,yd))


#pyautogui.moveTo(xc,yc)
#pyautogui.mouseDown(button='left') #按下鼠标按键
#pyautogui.dragTo(xd,yd,button='left',duration=2) #拖动鼠标到指定位置
#pyautogui.mouseUp()
#pyautogui.position()
#pyautogui.click()


